package com.ruoyi.tianliangedu.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.tianliangedu.domain.TianliangSonSection;
import com.ruoyi.tianliangedu.mapper.TianliangSonSectionMapper;
import com.ruoyi.tianliangedu.service.ITianliangSonSectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 子类章节Service业务层处理
 *
 * @author lsj
 * @date 2021-07-12
 */
@Service
public class TianliangSonSectionServiceImpl implements ITianliangSonSectionService {
    @Autowired
    private TianliangSonSectionMapper tianliangSonSectionMapper;

    /**
     * 查询子类章节
     *
     * @param sonSectionId 子类章节ID
     * @return 子类章节
     */
    @Override
    public TianliangSonSection selectTianliangSonSectionById(Long sonSectionId) {
        return tianliangSonSectionMapper.selectTianliangSonSectionById(sonSectionId);
    }

    /**
     * 查询子类章节列表
     *
     * @param tianliangSonSection 子类章节
     * @return 子类章节
     */
    @Override
    public List<TianliangSonSection> selectTianliangSonSectionList(TianliangSonSection tianliangSonSection) {
        return tianliangSonSectionMapper.selectTianliangSonSectionList(tianliangSonSection);
    }

    /**
     * 新增子类章节
     *
     * @param tianliangSonSection 子类章节
     * @return 结果
     */
    @Override
    public int insertTianliangSonSection(TianliangSonSection tianliangSonSection) {
        return tianliangSonSectionMapper.insertTianliangSonSection(tianliangSonSection);
    }

    /**
     * 修改子类章节
     *
     * @param tianliangSonSection 子类章节
     * @return 结果
     */
    @Override
    public int updateTianliangSonSection(TianliangSonSection tianliangSonSection) {
        return tianliangSonSectionMapper.updateTianliangSonSection(tianliangSonSection);
    }

    /**
     * 删除子类章节对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTianliangSonSectionByIds(String ids) {
        return tianliangSonSectionMapper.deleteTianliangSonSectionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除子类章节信息
     *
     * @param sonSectionId 子类章节ID
     * @return 结果
     */
    @Override
    public int deleteTianliangSonSectionById(Long sonSectionId) {
        return tianliangSonSectionMapper.deleteTianliangSonSectionById(sonSectionId);
    }
}
